#cs ----------------------------------------------------------------------------
	
	$Author: bjoern.kaiser $
	$LastChangedDate: 2008-04-16 09:06:15 +0000 (Wed, 16 Apr 2008) $
	
	Script Function:
	Logviewer
	
#ce ----------------------------------------------------------------------------

; Script Start - Add your code below here

#Include <GUIConstants.au3>

Opt("GUIOnEventMode", 1)

Dim $strPathToLog = @TempDir & "\unixp.log"
Dim $hLogFile = FileOpen($strPathToLog, 0)


Opt("GUIOnEventMode", 1)
#Region ### START Koda GUI section ### Form=g:\projekte\unixp\logviewer.kxf
$Form1_1 = GUICreate("UniXP Log", 633, 449, -1, -1)
$Edit1 = GUICtrlCreateEdit("", 8, 8, 617, 433, BitOR($ES_AUTOVSCROLL, $ES_AUTOHSCROLL, $ES_READONLY, $ES_WANTRETURN, $WS_HSCROLL, $WS_VSCROLL))
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

GUISetOnEvent($GUI_EVENT_CLOSE, "SpecialEvents")
GUISetOnEvent($GUI_EVENT_MINIMIZE, "SpecialEvents")
GUISetOnEvent($GUI_EVENT_MAXIMIZE, "SpecialEvents")
GUISetOnEvent($GUI_EVENT_RESTORE, "SpecialEvents")
GUISetOnEvent($GUI_EVENT_RESIZED, "SpecialEvents")
While 1
	$strLine = FileReadLine($hLogFile)
	If Not @error And Not $strLine = "" Then
		GUICtrlSetData($Edit1, $strLine & @CRLF, 1)
	EndIf
	Sleep(100)
WEnd
Func SpecialEvents()
	Switch @GUI_CtrlId
		Case $GUI_EVENT_RESIZED
		Case $GUI_EVENT_MAXIMIZE
		Case $GUI_EVENT_RESTORE
		Case $GUI_EVENT_CLOSE
			Exit
	EndSwitch
EndFunc   ;==>SpecialEvents